import {
    request
} from "@/utils/http";

export const requestShopCart = () => {
    return request.get('/api/cart/cartList')
}
//修改单个商品的选中状态
export const requestUpdateSingleCheck = ({
    skuId,
    isChecked
}) => {
    return request.get(`/api/cart/checkCart/${skuId}/${isChecked}`);
};

//修改所有购物车商品的选中状态
export const requestUpdateAllCheck = (isChecked, skuIdList) => {
    return request.post(`/api/cart/batchCheckCart/${isChecked}`, skuIdList);
};

//删除购物车单个商品
export const requestDeleteSingleGood = (skuId) => {
    return request.delete(`/api/cart/deleteCart/${skuId}`);
};

//删除所有的购物车商品
export const requestDeleteAllGoods = (skuIdList) => {
    return request.delete(`/api/cart/batchDeleteCart`, {
        data: skuIdList,
    });
};